package io.jpress.web;


import io.jpress.permission.*;

import java.util.ArrayList;
import java.util.List;

/**
 * 自定义权限组
 *
 * @author michael yang (fuhai999@gmail.com)
 */
public class AdminPermissions implements PermissionBuilder {

    public static final String MODIFY_USER_DEPARTMENT = "modify_user_department";
    public static final String ATTACHMENT_UPLOAD_ANY_SUFFIX = "attachment_upload_any_suffix";


    /**
     * JPress 系统默认权限
     */
    private static List<PermissionBean> corePermissions = new ArrayList<>();

    static {
        corePermissions.add(new PermissionBean(MODIFY_USER_DEPARTMENT, AdminPermissionGroups.DEFAULT_SENSITIVE
                , "修改用户部门信息", PermissionTypes.SENSITIVE, 111));

        corePermissions.add(new PermissionBean(ATTACHMENT_UPLOAD_ANY_SUFFIX, AdminPermissionGroups.DEFAULT_SENSITIVE,
                "允许上传任意类型文件", PermissionTypes.SENSITIVE, 333));
    }


    @Override
    public List<PermissionBean> buildPermissions() {
        return corePermissions;
    }
}
